package cheme.ProcessEditor.Figures;

import org.eclipse.draw2d.MouseEvent;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;

import cheme.ProcessEditor.ChemeConstants;


public class ProcessUnitFig extends ChemeImageFigure
{
	protected static final Image IMG_PROCESS_UNIT = ChemeConstants.DESC_PROCESS_UNIT.createImage();
	protected static final Image IMG_SEPARATOR = ChemeConstants.DESC_SEPARATOR.createImage();
	protected static final Image IMG_MIXER = ChemeConstants.DESC_MIXER.createImage();
	protected static final Image IMG_SINK = ChemeConstants.DESC_SINK.createImage();
	protected static final Image IMG_SOURCE = ChemeConstants.DESC_SOURCE.createImage();
	protected static final Image IMG_SPLIT_JOIN = ChemeConstants.DESC_SPLIT_JOIN.createImage();
	
	public ProcessUnitFig()
	{
		this(IMG_PROCESS_UNIT);
	}
	
	protected ProcessUnitFig(Image image)
	{
		super(image);
		
		setOpaque(true);
	}
	
	@Override
	public Dimension getPreferredSize(int wHint, int hHint)
	{
		Rectangle imageBounds = getImage().getBounds(); 
		return new Dimension(imageBounds.width + 6, imageBounds.height + 6);
	}

	/*@Override
	public void handleMouseReleased(MouseEvent event)
	{
		// TODO Auto-generated method stub
		super.handleMouseReleased(event);
	}*/
	
	
}
